<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>星元空间 - 工作台原型</title>
    <link rel="stylesheet" href="assets/css/common.css">
    <script src="https://cdn.jsdelivr.net/npm/sortablejs@latest/Sortable.min.js"></script>
    <style>
        /* 顶部导航栏 */
        .top-nav {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: var(--color-bg-white);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 var(--spacing-xxl);
            z-index: 1000;
        }

        .top-nav .logo {
            font-size: 20px;
            font-weight: 600;
            color: var(--color-text-primary);
        }

        .top-nav .nav-right {
            display: flex;
            align-items: center;
            gap: var(--spacing-lg);
        }

        .search-box {
            width: 300px;
            height: 36px;
            padding: 0 12px 0 36px;
            border: 1px solid var(--color-border-base);
            border-radius: var(--radius-sm);
            font-size: 14px;
            background: var(--color-bg);
        }

        .search-icon {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--color-text-placeholder);
        }

        .icon-btn {
            width: 36px;
            height: 36px;
            border: none;
            background: transparent;
            cursor: pointer;
            color: var(--color-text-regular);
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-sm);
        }

        .icon-btn:hover {
            background: var(--color-bg);
            color: var(--color-primary);
        }

        /* 移动端菜单按钮 */
        .menu-toggle {
            display: none;
            width: 44px;
            height: 44px;
            border: none;
            background: transparent;
            cursor: pointer;
            color: var(--color-text-regular);
            font-size: 20px;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-sm);
        }

        .menu-toggle:hover {
            background: var(--color-bg);
        }

        /* 移动端侧边栏遮罩 */
        .sidebar-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 999;
        }

        .sidebar-overlay.active {
            display: block;
        }

        /* 主容器 */
        .main-container {
            display: flex;
            margin-top: 60px;
            min-height: calc(100vh - 60px);
        }

        /* 侧边栏 */
        .sidebar {
            width: 200px;
            background: var(--color-bg-white);
            padding: var(--spacing-xxl) 0;
            box-shadow: 2px 0 8px rgba(0,0,0,0.05);
            position: fixed;
            left: 0;
            top: 60px;
            bottom: 0;
            overflow-y: auto;
        }

        .sidebar-item {
            padding: var(--spacing-md) var(--spacing-xxl);
            color: var(--color-text-regular);
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: var(--spacing-md);
        }

        .sidebar-item:hover {
            background: #ECF5FF;
            color: var(--color-primary);
        }

        .sidebar-item.active {
            background: #ECF5FF;
            color: var(--color-primary);
            border-right: 3px solid var(--color-primary);
        }

        /* 主内容区 */
        .main-content {
            flex: 1;
            padding: var(--spacing-xxl);
            margin-left: 200px;
        }

        .page-header {
            margin-bottom: var(--spacing-xxl);
        }

        .page-header h1 {
            font-size: 24px;
            color: var(--color-text-primary);
            margin-bottom: 8px;
        }

        .page-header p {
            color: var(--color-text-secondary);
            font-size: 14px;
        }

        .page-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: var(--spacing-xxl);
        }

        .view-toggle {
            display: flex;
            gap: 4px;
            background: var(--color-bg-white);
            padding: 4px;
            border-radius: var(--radius-sm);
            border: 1px solid var(--color-border-base);
        }

        .view-toggle button {
            padding: 8px 12px;
            border: none;
            background: transparent;
            cursor: pointer;
            border-radius: var(--radius-sm);
            color: var(--color-text-regular);
        }

        .view-toggle button.active {
            background: var(--color-bg);
            color: var(--color-primary);
        }

        /* 统计卡片 */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: var(--spacing-lg);
            margin-bottom: var(--spacing-xxl);
        }

        .stat-card {
            background: var(--color-bg-white);
            border-radius: var(--radius-md);
            padding: var(--spacing-xxl);
            box-shadow: var(--shadow-sm);
        }

        .stat-card .stat-title {
            color: var(--color-text-secondary);
            font-size: 14px;
            margin-bottom: 12px;
        }

        .stat-card .stat-value {
            font-size: 32px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .stat-card .stat-trend {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 12px;
            color: var(--color-text-secondary);
        }

        .stat-card .stat-icon {
            font-size: 32px;
            float: right;
            margin-top: -40px;
        }

        /* 考勤打卡卡片 */
        .attendance-card {
            background: linear-gradient(135deg, rgba(24, 144, 255, 0.05) 0%, rgba(82, 196, 26, 0.05) 100%);
            border: 1px solid var(--color-border-lighter);
            border-radius: var(--radius-md);
            padding: var(--spacing-xxl);
            margin-bottom: var(--spacing-xxl);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .attendance-card .attendance-info {
            display: flex;
            align-items: center;
            gap: var(--spacing-lg);
        }

        .attendance-card .attendance-icon {
            width: 48px;
            height: 48px;
            background: var(--color-primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
        }

        /* 应用卡片网格 */
        .apps-section {
            background: var(--color-bg-white);
            border-radius: var(--radius-md);
            padding: var(--spacing-xxl);
            box-shadow: var(--shadow-sm);
            margin-bottom: var(--spacing-xxl);
        }

        .apps-section h3 {
            font-size: 18px;
            color: var(--color-text-primary);
            margin-bottom: var(--spacing-lg);
        }

        .apps-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: var(--spacing-lg);
        }

        .app-card {
            background: var(--color-bg-white);
            border: 1px solid var(--color-border-lighter);
            border-radius: var(--radius-md);
            padding: var(--spacing-xxl);
            text-align: center;
            cursor: pointer;
            transition: all 0.3s;
        }

        .app-card:hover {
            transform: translateY(-4px);
            box-shadow: var(--shadow-md);
            border-color: var(--color-primary);
        }

        .app-card .app-icon {
            font-size: 48px;
            margin-bottom: 12px;
        }

        .app-card .app-name {
            font-size: 16px;
            color: var(--color-text-primary);
            font-weight: 500;
            margin-bottom: 6px;
        }

        .app-card .app-desc {
            font-size: 12px;
            color: var(--color-text-secondary);
        }

        /* 任务和活动 */
        .info-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: var(--spacing-xxl);
        }

        .info-panel {
            background: var(--color-bg-white);
            border-radius: var(--radius-md);
            padding: var(--spacing-xxl);
            box-shadow: var(--shadow-sm);
        }

        .info-panel h3 {
            font-size: 18px;
            color: var(--color-text-primary);
            margin-bottom: var(--spacing-lg);
            padding-bottom: var(--spacing-md);
            border-bottom: 1px solid var(--color-border-lighter);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .badge {
            display: inline-block;
            padding: 2px 8px;
            background: var(--color-bg);
            color: var(--color-text-regular);
            border-radius: 12px;
            font-size: 12px;
        }

        .task-item, .activity-item {
            padding: var(--spacing-md) 0;
            border-bottom: 1px solid var(--color-border-lighter);
            cursor: pointer;
        }

        .task-item:last-child, .activity-item:last-child {
            border-bottom: none;
        }

        .task-item:hover, .activity-item:hover {
            background: var(--color-bg);
            margin: 0 calc(-1 * var(--spacing-xxl));
            padding: var(--spacing-md) var(--spacing-xxl);
        }

        .task-title, .activity-title {
            font-size: 14px;
            color: var(--color-text-primary);
            margin-bottom: 4px;
        }

        .task-meta, .activity-time {
            font-size: 12px;
            color: var(--color-text-secondary);
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .priority {
            display: inline-block;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 11px;
        }

        .priority.high {
            background: #FFF1F0;
            color: var(--color-danger);
        }

        .priority.medium {
            background: #FFFBE6;
            color: var(--color-warning);
        }

        .priority.low {
            background: #F6FFED;
            color: var(--color-success);
        }

        .view-all {
            text-align: center;
            margin-top: var(--spacing-lg);
        }

        .view-all a {
            color: var(--color-primary);
            text-decoration: none;
            font-size: 14px;
        }

        /* 移动端适配 */
        @media (max-width: 768px) {
            .top-nav {
                height: 56px;
                padding: 0 var(--spacing-md);
            }

            .menu-toggle {
                display: flex;
            }

            .search-box {
                display: none;
            }

            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s ease;
                z-index: 1000;
                width: 260px;
            }

            .sidebar.active {
                transform: translateX(0);
            }

            .main-container {
                margin-top: 56px;
            }

            .main-content {
                margin-left: 0;
                padding: var(--spacing-md);
                width: 100%;
            }

            .page-header h1 {
                font-size: 20px;
            }

            .page-header p {
                font-size: 13px;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: var(--spacing-md);
            }

            .stat-card {
                padding: var(--spacing-md);
            }

            .stat-title {
                font-size: 12px;
            }

            .stat-value {
                font-size: 24px;
            }

            .apps-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: var(--spacing-md);
            }

            .app-card {
                padding: var(--spacing-md);
            }

            .app-icon {
                font-size: 32px;
            }

            .app-name {
                font-size: 14px;
            }

            .app-desc {
                font-size: 12px;
            }

            .info-grid {
                grid-template-columns: 1fr;
                gap: var(--spacing-md);
            }

            .attendance-card {
                flex-direction: column;
                align-items: flex-start;
                gap: var(--spacing-lg);
                padding: var(--spacing-md);
            }

            .attendance-card .btn {
                width: 100%;
            }

            .page-toolbar {
                flex-direction: column;
                gap: var(--spacing-md);
                align-items: stretch;
            }

            .view-toggle {
                width: 100%;
            }

            .view-toggle button {
                flex: 1;
            }
        }

        /* 小屏幕手机 */
        @media (max-width: 480px) {
            .stats-grid {
                grid-template-columns: 1fr;
            }

            .apps-grid {
                grid-template-columns: 1fr;
            }

            .app-card {
                flex-direction: row;
                align-items: center;
                gap: var(--spacing-md);
            }

            .app-icon {
                font-size: 40px;
            }

            .task-item, .activity-item {
                padding: var(--spacing-sm) 0;
            }
        }
    </style>
</head>
<body>
    <!-- 移动端侧边栏遮罩 -->
    <div class="sidebar-overlay" id="sidebarOverlay"></div>

    <!-- 顶部导航栏 -->
    <div class="top-nav">
        <button class="menu-toggle" id="menuToggle">☰</button>
        <div class="logo">星元空间</div>
        <div class="nav-right">
            <div style="position: relative;">
                <svg class="search-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor">
                    <circle cx="11" cy="11" r="8"></circle>
                    <path d="m21 21-4.35-4.35"></path>
                </svg>
                <input type="text" class="search-box" placeholder="搜索系统入口、任务...">
            </div>
            <button class="icon-btn">🔔</button>
            <button class="icon-btn">👤</button>
        </div>
    </div>

    <!-- 主容器 -->
    <div class="main-container">
        <!-- 侧边栏 -->
        <div class="sidebar">
            <div class="sidebar-item active">工作台</div>
            <div class="sidebar-item">入口管理</div>
            <div class="sidebar-item">任务中心</div>
            <div class="sidebar-item">个人中心</div>
        </div>

        <!-- 主内容区 -->
        <div class="main-content">
            <div class="page-header">
                <h1>工作台</h1>
                <p>欢迎回来，今天是 2024年1月15日 星期一</p>
            </div>

            <div class="page-toolbar">
                <div></div>
                <div class="view-toggle">
                    <button class="active" data-view="grid">网格</button>
                    <button data-view="list">列表</button>
                </div>
            </div>

            <!-- 统计卡片 -->
            <div class="stats-grid">
                <div class="stat-card">
                    <div class="stat-title">待办任务</div>
                    <div class="stat-value" style="color: var(--color-primary);">12</div>
                    <div class="stat-trend">
                        <span style="color: var(--color-success);">↑</span>
                        <span>+3</span>
                    </div>
                    <div class="stat-icon">📋</div>
                </div>
                <div class="stat-card">
                    <div class="stat-title">今日访问</div>
                    <div class="stat-value" style="color: var(--color-success);">48</div>
                    <div class="stat-trend">
                        <span style="color: var(--color-success);">↑</span>
                        <span>+12%</span>
                    </div>
                    <div class="stat-icon">👁️</div>
                </div>
                <div class="stat-card">
                    <div class="stat-title">待审批</div>
                    <div class="stat-value" style="color: var(--color-warning);">5</div>
                    <div class="stat-trend">
                        <span style="color: var(--color-danger);">↓</span>
                        <span>-2</span>
                    </div>
                    <div class="stat-icon">✓</div>
                </div>
                <div class="stat-card">
                    <div class="stat-title">消息通知</div>
                    <div class="stat-value" style="color: var(--color-danger);">23</div>
                    <div class="stat-trend">
                        <span style="color: var(--color-success);">↑</span>
                        <span>+8</span>
                    </div>
                    <div class="stat-icon">🔔</div>
                </div>
            </div>

            <!-- 考勤打卡 -->
            <div class="attendance-card">
                <div class="attendance-info">
                    <div class="attendance-icon">🕐</div>
                    <div>
                        <h3 style="font-size: 16px; margin-bottom: 4px; color: var(--color-text-primary);">考勤打卡</h3>
                        <p style="font-size: 14px; color: var(--color-text-secondary);">今日尚未打卡</p>
                    </div>
                </div>
                <button class="btn btn-primary" style="background: var(--color-success);">立即打卡</button>
            </div>

            <!-- 应用卡片 -->
            <div class="apps-section">
                <h3>常用应用</h3>
                <div class="apps-grid" id="appsGrid">
                    <div class="app-card" data-id="1">
                        <div class="app-icon">📊</div>
                        <div class="app-name">ERP系统</div>
                        <div class="app-desc">企业资源规划</div>
                    </div>
                    <div class="app-card" data-id="2">
                        <div class="app-icon">👥</div>
                        <div class="app-name">CRM系统</div>
                        <div class="app-desc">客户关系管理</div>
                    </div>
                    <div class="app-card" data-id="3">
                        <div class="app-icon">📝</div>
                        <div class="app-name">OA系统</div>
                        <div class="app-desc">办公自动化</div>
                    </div>
                    <div class="app-card" data-id="4">
                        <div class="app-icon">👔</div>
                        <div class="app-name">HR系统</div>
                        <div class="app-desc">人力资源管理</div>
                    </div>
                    <div class="app-card" data-id="5">
                        <div class="app-icon">💰</div>
                        <div class="app-name">财务系统</div>
                        <div class="app-desc">财务管理</div>
                    </div>
                    <div class="app-card" data-id="6">
                        <div class="app-icon">📋</div>
                        <div class="app-name">项目管理</div>
                        <div class="app-desc">项目协作</div>
                    </div>
                    <div class="app-card" data-id="7">
                        <div class="app-icon">📚</div>
                        <div class="app-name">知识库</div>
                        <div class="app-desc">文档管理</div>
                    </div>
                    <div class="app-card" data-id="8">
                        <div class="app-icon">📈</div>
                        <div class="app-name">报表中心</div>
                        <div class="app-desc">数据分析</div>
                    </div>
                </div>
            </div>

            <!-- 任务和活动 -->
            <div class="info-grid">
                <!-- 待办任务 -->
                <div class="info-panel">
                    <h3>
                        <span>待办任务</span>
                        <span class="badge">4</span>
                    </h3>
                    <div class="task-item">
                        <div class="task-title">审批采购申请 #2024001</div>
                        <div class="task-meta">
                            <span class="priority high">高优先级</span>
                            <span>今天 18:00</span>
                        </div>
                    </div>
                    <div class="task-item">
                        <div class="task-title">完成月度总结报告</div>
                        <div class="task-meta">
                            <span class="priority medium">中优先级</span>
                            <span>明天 12:00</span>
                        </div>
                    </div>
                    <div class="task-item">
                        <div class="task-title">审核新员工入职资料</div>
                        <div class="task-meta">
                            <span class="priority high">高优先级</span>
                            <span>今天 15:00</span>
                        </div>
                    </div>
                    <div class="task-item">
                        <div class="task-title">参加产品评审会议</div>
                        <div class="task-meta">
                            <span class="priority low">低优先级</span>
                            <span>2天后</span>
                        </div>
                    </div>
                    <div class="view-all">
                        <a href="#">查看全部任务 →</a>
                    </div>
                </div>

                <!-- 最近活动 -->
                <div class="info-panel">
                    <h3>最近活动</h3>
                    <div class="activity-item">
                        <div class="activity-title">登录ERP系统</div>
                        <div class="activity-time">5分钟前</div>
                    </div>
                    <div class="activity-item">
                        <div class="activity-title">审批完成采购申请 #2024000</div>
                        <div class="activity-time">1小时前</div>
                    </div>
                    <div class="activity-item">
                        <div class="activity-title">创建项目文档</div>
                        <div class="activity-time">2小时前</div>
                    </div>
                    <div class="activity-item">
                        <div class="activity-title">参加团队会议</div>
                        <div class="activity-time">3小时前</div>
                    </div>
                    <div class="view-all">
                        <a href="#">查看更多活动 →</a>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="assets/js/common.js"></script>
    <script>
        // 视图切换
        const viewButtons = document.querySelectorAll('.view-toggle button');
        viewButtons.forEach(btn => {
            btn.addEventListener('click', () => {
                viewButtons.forEach(b => b.classList.remove('active'));
                btn.classList.add('active');
                const view = btn.dataset.view;
                const grid = document.getElementById('appsGrid');
                if (view === 'list') {
                    grid.style.gridTemplateColumns = '1fr';
                } else {
                    grid.style.gridTemplateColumns = 'repeat(auto-fill, minmax(180px, 1fr))';
                }
            });
        });

        // 应用卡片点击
        document.querySelectorAll('.app-card').forEach(card => {
            card.addEventListener('click', () => {
                const name = card.querySelector('.app-name').textContent;
                showToast(`点击了 ${name} 入口`, 'success');
            });
        });

        // 拖拽排序
        if (typeof Sortable !== 'undefined') {
            new Sortable(document.getElementById('appsGrid'), {
                animation: 150,
                ghostClass: 'sortable-ghost',
                onEnd: function() {
                    showToast('应用顺序已更新', 'success');
                }
            });
        }

        // 移动端菜单切换
        const menuToggle = document.getElementById('menuToggle');
        const sidebar = document.querySelector('.sidebar');
        const sidebarOverlay = document.getElementById('sidebarOverlay');

        function toggleSidebar() {
            sidebar.classList.toggle('active');
            sidebarOverlay.classList.toggle('active');
        }

        function closeSidebar() {
            sidebar.classList.remove('active');
            sidebarOverlay.classList.remove('active');
        }

        if (menuToggle) {
            menuToggle.addEventListener('click', toggleSidebar);
        }

        if (sidebarOverlay) {
            sidebarOverlay.addEventListener('click', closeSidebar);
        }

        // 侧边栏导航
        document.querySelectorAll('.sidebar-item').forEach(item => {
            item.addEventListener('click', () => {
                document.querySelectorAll('.sidebar-item').forEach(i => i.classList.remove('active'));
                item.classList.add('active');
                
                // 移动端点击后关闭侧边栏
                if (window.innerWidth <= 768) {
                    closeSidebar();
                }
                
                const text = item.textContent.trim();
                if (text === '入口管理') {
                    window.location.href = 'entry-management-prototype.html';
                }
            });
        });
    </script>
    <style>
        .sortable-ghost {
            opacity: 0.4;
        }
    </style>
</body>
</html>

